package com.lch.netty.netty.tomcat.http;

import java.io.IOException;

/**
 * @author: liuchenhui
 * @create: 2019-10-14 14:04
 **/
public abstract class NServlet {
    public void service(NRequest request, NResponse response) throws IOException {
        if ("GET".equalsIgnoreCase(request.getMethod())) {
            doGet(request, response);
        } else {
            doPost(request, response);
        }
    }

    protected abstract void doGet(NRequest request, NResponse response) throws IOException;

    protected abstract void doPost(NRequest request, NResponse response) throws IOException;
}